home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C / Applications / Tcl-Tk 8.0 / Pre-installed version / MacTk README < prev    next >
Encoding:
Text File  |  1997-08-15  |  9.8 KB  |  270 lines  |  [TEXT/ALFA]

  1. Tk 8.0 for Macintosh
  2.  
  3. by Ray Johnson
  4. Sun Microsystems Laboratories
  5. rjohnson@eng.sun.com
  6.  
  7. SCCS: @(#) README 1.28 97/08/15 09:23:06
  8.  
  9. 1. Introduction
  10. ---------------
  11.  
  12. This is the README file for the Macintosh version of the Tk
  13. extension for the Tcl scripting language.  The file consists of
  14. information specific to the Macintosh version of Tcl and Tk.  For more
  15. general information please read the README file in the main Tk
  16. directory.
  17.  
  18. 2. What's new?
  19. -------------
  20.  
  21. Native Look & Feel!!!  We now try really hard to support the 
  22. Macintosh Look & Feel with Tcl/Tk 8.0.  We aren't finished but
  23. it look pretty good.  Let me know what are the most "un-mac like"
  24. problems and I'll fix them as quickly as I can.
  25.  
  26. The button, checkbutton, radiobutton, and scrollbar widgets actually
  27. use the Mac toolbox controls.  This means that they will track the
  28. look&feel if you use extension that change the appearance of
  29. applications (like Aaron.)  We also use "system" colors so the default
  30. backgrounds etc. will also change colors.  We plan to support this
  31. feature - so let me know if something doesn't work quite right.
  32. Unfortunantly, this doesn't work on the latest beta of MacOS 8.  We
  33. are working with them on this - we will certainly support the MacOS 8
  34. look&feel by the time we go final.
  35.  
  36. We also now support native menus!  By using the new -menu option
  37. on toplevels you can have a menubar that is cross platform.  You
  38. can also place Tk menus in the Apple and Help menus!  Check out
  39. the documentation for more details.  Syd Polk <icepick@eng.sun.com> is
  40. the author of the new menu code.  Feel free to contact him if you
  41. have questions or comments about the menu mechanism.
  42.  
  43. The "tk_messageBox" command on the Macintosh is now much more
  44. mac-like.  I'll probably still need to adjust this more - but it
  45. looks a hell of alot better than it did before.
  46.  
  47. I've also added a command that allows you to get more native window
  48. styles.  However, we have yet to decide on a cross platform solution
  49. to the problem of varying window styles.  None the less, I thought
  50. it would be use full to add the capability in an unsupported means
  51. to tide you over until a better solution is available.  The command
  52. is called "unsupported1".  It can be used in the following way:
  53.  
  54.     toplevel .foo; unsupported1 style .foo zoomDocProc
  55.  
  56. The above command will create a document window with a zoom box.
  57. Type "unsupported1 style . ???" to get a list of the supported
  58. styles.  The command works like "wm overrideredirect" - you must
  59. make the call before the window is mapped.
  60.  
  61. As always - report the bugs you find - including asthetic ones
  62. in the look & feel of widgets.
  63.  
  64. 3. Mac specific features
  65. ------------------------
  66.  
  67. There are several features or enhancements in Tk that are unique to 
  68. the Macintosh version of Tk.  Here is a list of those features and
  69. pointers to where you can find more information about the feature.
  70.  
  71. * The menu command has special rules for accessing the Macintosh
  72.   Apple and Help menus.  See the menu.m man page for details.
  73.  
  74. * If you have the special Tcl function "tkAboutDialog" defined, it
  75.   will be called instead of displaying the default About Box in the
  76.   console or other parts of the Wish application.  See below for
  77.   details.
  78.  
  79. * In addition to the standard X cursors, the Mac version of Tk will
  80.   let you use any Mac cursor that is named and installed in your
  81.   application.  See the GetCursor.3 man page for details.
  82.  
  83. * The wish application has a couple of hooks to know about the exit
  84.   and "open document" Mac High Level events.  See below for details.
  85.  
  86. * The command unsupported1 will allow you to set the style of new
  87.   toplevel windows on the Macintosh.  It is not really supported.
  88.   See below for details.
  89.  
  90. * In addition to the standard built-in bitmaps that Tk supports, the
  91.   Mac version of Tk allows you to use several Mac specific icons.  See
  92.   the GetBitmap.3 man page for a complete list.
  93.  
  94. * The send command does not yet work on the Macintosh.  We hope to
  95.   have it available in Tk 8.1.
  96.  
  97. * The -use and -container options almost work - but have some
  98.   known bugs that cause some major problems.  Be careful, if you
  99.   decide to use these features.  (See bugs.doc for details.)
  100.  
  101. 4. The Distribution
  102. -------------------
  103.  
  104. Macintosh Tk is distributed in three different forms.  This 
  105. should make it easier to only download what you need.  The 
  106. packages are as follows:
  107.  
  108. mactk8.0.sea.hqx
  109.  
  110.     This distribution is a "binary" only release.  It contains an
  111.     installer program that will install a 68k, PowerPC, or Fat
  112.     version of the "Wish" application.  In addition, in installs
  113.     the Tcl & Tk libraries in the Extensions folder inside your
  114.     System Folder.  (No "INIT"'s or Control Pannels are installed.)
  115.  
  116. mactcltk-full-8.0.sea.hqx
  117.  
  118.     This release contains the full release of Tcl and Tk for the
  119.     Macintosh plus the More Files package on which Macintosh Tcl and
  120.     Tk rely.
  121.  
  122. mactk-source-8.0.sea.hqx
  123.  
  124.     This release contains the complete source to Tk for the Macintosh
  125.     In addition, Metrowerks CodeWarrior libraries and project files
  126.     are included.  However, you must already have the More Files
  127.     package to compile this code.
  128.  
  129. 5. Documentation
  130. ----------------
  131.  
  132. Two books are currently available for Tcl.  Both provide a good
  133. introduction to the language.  It is a good way to get started
  134. if you haven't used the language before:
  135.  
  136.     Title:            Tcl and the Tk Toolkit
  137.     Author:            John K. Ousterhout
  138.     Publisher:            Addison-Wesley
  139.     ISBN:            0-201-63337-X
  140.  
  141.     Title:            Practical Programming in Tcl and Tk
  142.     Author:            Brent Welch
  143.     Publisher:            Prentice Hall
  144.     ISBN:            0-13-182007-9
  145.  
  146. The "doc" subdirectory contains reference in documentation
  147. in the "man" format found on most UNIX machines.  Unfortunately,
  148. there is not a suitable way to view these pages on the Macintosh.  
  149. A version suitable for viewing on the Macintosh has yet to be
  150. developed.  We are working are having better documentation for
  151. the Macintosh platform in the future.  However, if you have WWW 
  152. access you may access the Man pages at the following URL:
  153.  
  154.     http://sunscript.sun.com/man/tcl8.0/contents.html
  155.  
  156. Other documentation and sample Tcl scripts can be found at
  157. the Tcl ftp site: 
  158.  
  159.     ftp://ftp.neosoft.com/tcl/
  160.  
  161. The internet news group comp.lang.tcl is also a valuable
  162. source of information about Tcl.  A mailing list is also
  163. available (see below).
  164.  
  165. 6. Compiling Tk
  166. ---------------
  167.  
  168. In order to compile Macintosh Tk you must have the 
  169. following items:
  170.  
  171.     CodeWarrior Pro 1 or higher (CodeWarrior release 9 or higher can work
  172.         and we have project files, but we are depricating support)
  173.     Mac Tcl 8.0 (source)
  174.       (which requires More Files 1.4.2 or 1.4.3)
  175.     Mac Tk 8.0 (source)
  176.  
  177. The project  files included with the Mac Tcl source should work 
  178. fine.  The only thing you may need to update are the access paths.
  179.  
  180. Special notes:
  181.  
  182. * Check out the file bugs.doc for information about known bugs.
  183.  
  184. 7. About Dialog
  185. ---------------
  186.  
  187. There is now a way to replace the default dialog box for the Wish
  188. application.  If you create the tcl procedure "tkAboutDialog" it will
  189. be called instead of creating the default dialog box.  Your procedure
  190. is then responsible for displaying a window, removing it, etc.  This
  191. interface is experimental and may change in the future - tell me what
  192. you think of it.
  193.  
  194. 8. Apple Events
  195. ---------------
  196.  
  197. Tcl/Tk currently doesn't have much in the way of support for Mac
  198. Apple Events.  There is no way to send an apple event (although you
  199. could write an extension to do this) and no general purpose way to
  200. recieve apple events.  However, there are a couple of hooks for
  201. dealing with some of the standard apple events.
  202.  
  203.     exit - Generally, Tcl cleans up after it self when you exit.
  204.     However, your application may want to do application specifc
  205.     cleanup like saving a users data.  To do this you can rename
  206.     the exit command to something else.  Define your own exit
  207.     command to do whatever clean up you like and then call the
  208.     origional exit command.  For example,
  209.  
  210.         rename exit __exit
  211.         proc exit {} {
  212.           # Do your clean up hear
  213.           __exit
  214.         }
  215.  
  216.     Both incoming quit events and hitting the Quit menu item
  217.     will call the exit command.  However, don't expect you can
  218.     abort the exit.  Tk may exit anyway if the exit command it
  219.     calls does not actually quit the application.
  220.  
  221.     open - The other apple event Tk supports is the open event.  The
  222.     open event is sent to Tk if, for example, you drop a file on
  223.     the Wish icon.  If you define a Tcl procedure with the name
  224.     "tkOpenDocument" it will be invoked on any Open Document
  225.     events that the application receives.  The a list of paths to
  226.     the various documents will be passed to the Tcl function.
  227.     Here is an example,
  228.  
  229.         proc tkOpenDocument args {
  230.           foreach file $args {
  231.             # Deal with passed in file path
  232.           }
  233.         }
  234.  
  235.     Note: This isn't every thing you need to do to make your
  236.     application dropable.  You must still define a FREF resource
  237.     that makes sense for your application domain.  (Out of the
  238.     box, you will not be able to drop files on the Wish
  239.     application.  See the Inside Macintosh documentation for
  240.     details about the FREF resource.
  241.  
  242. 8. unsupported1
  243. ---------------
  244.  
  245. The unsupported1 command is a short term hack we made available to
  246. allow you to set the window style of a new toplevel window.  It works 
  247. much like the "wm overrideredirect" and "wm transient" commands in
  248. that it must be run before the window it's being applied to is mapped.
  249.  
  250. The syntax of the command is as follows:
  251.  
  252.     unsupported1 style <window> ?style?
  253.  
  254. The <window> must be a toplevel window.  If the style is not given
  255. then the current style for the window is returned.  If you want to set
  256. the style you must do so before the window gets mapped for the first
  257. time.  The possible window styles include:
  258.  
  259.     documentProc, dBoxProc, plainDBox, altDBoxProc,
  260.     movableDBoxProc, zoomDocProc, rDocProc, floatProc,
  261.     floatZoomProc, floatSideProc, or floatSideZoomProc
  262.  
  263. NOTE: this is an unsupported command and it WILL go away in the
  264. future.
  265.  
  266.  
  267. If you have comments or Bug reports send them to:
  268. Jim Ingham
  269. jingham@eng.sun.com
  270.